home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / sysdeps / stub / sysd-stdio.c < prev    next >
C/C++ Source or Header  |  1994-05-27  |  3KB  |  112 lines

  1. /* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. #include <ansidecl.h>
  20. #include <errno.h>
  21. #include <stdio.h>
  22.  
  23.  
  24. /* Read up to N chars into BUF from COOKIE.
  25.    Return how many chars were read, 0 for EOF or -1 for error.  */
  26. int
  27. DEFUN(__stdio_read, (cookie, buf, n),
  28.       PTR cookie AND register char *buf AND register size_t n)
  29. {
  30.   errno = ENOSYS;
  31.   return -1;
  32. }
  33.  
  34. /* Write up to N chars from BUF to COOKIE.
  35.    Return how many chars were written or -1 for error.  */
  36. int
  37. DEFUN(__stdio_write, (cookie, buf, n),
  38.       PTR cookie AND register CONST char *buf AND register size_t n)
  39. {
  40.   errno = ENOSYS;
  41.   return -1;
  42. }
  43.  
  44. /* Move COOKIE's file position *POS bytes, according to WHENCE.
  45.    The new file position is stored in *POS.
  46.    Returns zero if successful, nonzero if not.  */
  47. int
  48. DEFUN(__stdio_seek, (cookie, pos, whence),
  49.       PTR cookie AND fpos_t *pos AND int whence)
  50. {
  51.   errno = ENOSYS;
  52.   return -1;
  53. }
  54.  
  55. /* Close the file associated with COOKIE.
  56.    Return 0 for success or -1 for failure.  */
  57. int
  58. DEFUN(__stdio_close, (cookie), PTR cookie)
  59. {
  60.   errno = ENOSYS;
  61.   return -1;
  62. }
  63.  
  64. /* Return the POSIX.1 file descriptor associated with COOKIE,
  65.    or -1 for errors.  If COOKIE does not relate to any POSIX.1 file
  66.    descriptor, this should return -1 with errno set to EOPNOTSUPP.  */
  67. int
  68. DEFUN(__stdio_fileno, (cookie), PTR cookie)
  69. {
  70.   errno = ENOSYS;
  71.   return -1;
  72. }
  73.  
  74.  
  75. /* Open FILENAME with the mode in M.
  76.    Store the magic cookie associated with the opened file in *COOKIEPTR.
  77.    Return zero on success and nonzero on failure.  */   
  78. int
  79. DEFUN(__stdio_open, (filename, m, cookieptr),
  80.       CONST char *filename AND __io_mode m AND PTR *cookieptr)
  81. {
  82.   errno = ENOSYS;
  83.   return -1;
  84. }
  85.  
  86.  
  87. /* Open FILENAME with the mode in M.  Use the same magic cookie
  88.    already in *COOKIEPTR if possible, closing the old cookie with CLOSEFN.  */
  89. int
  90. DEFUN(__stdio_reopen, (filename, m, cookieptr),
  91.       CONST char *filename AND __io_mode m AND
  92.       PTR *cookieptr AND __io_close closefn)
  93. {
  94.   errno = ENOSYS;
  95.   return -1;
  96. }
  97.  
  98.  
  99. #ifdef     HAVE_GNU_LD
  100.  
  101. #include <gnu-stabs.h>
  102.  
  103. stub_warning(__stdio_read);
  104. stub_warning(__stdio_write);
  105. stub_warning(__stdio_seek);
  106. stub_warning(__stdio_close);
  107. stub_warning(__stdio_fileno);
  108. stub_warning(__stdio_open);
  109. stub_warning(__stdio_reopen);
  110.  
  111. #endif    /* GNU stabs.  */
  112.